package com.c6906.vdam.dps.common;

import com.c6906.vdam.dps.dto.ResultCode;
import org.apache.commons.lang.StringUtils;

public class CustomException extends RuntimeException {
    private static final long serialVersionUID = 3249382887671733358L;
    private String code;

    public String getCode() {
        return this.code;
    }

    public CustomException(String code, String message) {
        super(message);
        this.code = (StringUtils.isNotBlank(code) ? code : "100000");
    }

    public CustomException(String message) {
        super(message);
        this.code = "100000";
    }

    public CustomException(ResultCode resultCode) {
        super(resultCode.getMsg());
        this.code = resultCode.getCode();
    }
}